<?php
include("system/core/sessions.class.php");
include("system/users/userAccess.class.php");
include("system/db/dbconnect.class.php");
include("system/display/navdisplay.class.php");

include("system/config/config.php");
$sess = new Session();

$nav = new Navdisplay();

$user = new userAccess();
$user->isLoggedIn(1);

include("system/cart/cart.class.php");
$CART = new Cart();

include("system/display/genericdisplay.class.php");
$genDisplay = new Genericdisplay();
$headerImage = $genDisplay->displayHeaderImage();

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="application/xhtml+xml; charset=iso-8859-1"  /><meta name="description" content="CSS 3 Column Layout Technique Example."></meta>
<link rel="shortcut icon" href="http://www.tanfa.co.uk/favicon.ico" />
<title>Your Shopping Cart - <?php echo (SITENAME); ?> Toolbox</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1"  />
<script type="text/JavaScript" src="js/numberformat.js"></script>

<style type="text/css" media="screen">	@import "styles/mainstyle.css"; </style>



<?php
if (isset($_SESSION['lob'])){
echo ("<link rel=\"stylesheet\" type=\"text/css\" href=\"styles/".$lob.".css\" />");
}
?>
<!--[if lte IE 7]>
<style type="text/css">
html .ddsmoothmenu{height: 1%;} /*Holly Hack for IE7 and below*/
</style>
<![endif]-->
<?php
if (isset($_SESSION['lob'])){
echo ("<link rel=\"stylesheet\" type=\"text/css\" href=\"styles/".$_SESSION['lob'].".css\" />");
}
?>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>




<script src="js/jquery.accordion-1.2.2.source.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
		// <![CDATA[
			
		$(document).ready(function () {
			$('ul.accordion').accordion();
		});
				
		// ]]>
	</script>
<script type="text/javascript">
		
		function confirmsend(){
			if ( document.getElementById('sapNumber').value == "" ) {
			
				alert("You need to enter a SAP Purchase Order Number");
				document.getElementById('sapNumber').focus();
				return false;
			}
				document.getElementById('formLink').href = "processorder.php?sap="+document.getElementById('sapNumber').value;
				return true;
		}
		
		
	</script>
	
	
	

<!--[if IE]>
<link rel="stylesheet" type="text/css" href="styles/ie.css" />
<![endif]-->

</head>

<body>
<div id="wrapper">
	<div id="header">
	<div  id="homelink">
	
<a href="home.php">home</a>
<a href="contact.php">contact</a>
<a href="howtouse.php">how to use</a>

</div>
<div id="welcomeMessage">
<p>Welcome <?php echo $_SESSION['realname']; ?> <a href="logout.php">(logout)</a></p>
</div>

	
		<img src="images/<?php echo $headerImage; ?>" alt=""/>
	</div>
	
	<?php
	echo $CART->showMiniCart($_SESSION['username']);
	?>
	<div id="container">
		

		<div id="content" class="oneColumn">

		<div class="infobar">
		<?php
		if ($CART->isEmpty == false){
		?>
		<a href="processorder.php" class="checkout" onclick="return confirmsend();" id="formLink">
		<img src="images/processOrder.jpg" alt="" width="153" height="38" />
		</a>
		<?php } ?>
		<h1>Your Cart</h1>
		</div>
				
		<div style="float:right;width:300px;margin-right:20px;margin-top:20px;">
                    
		<div style="padding:10px;border:1px solid #ff0000;">
		<h3>SAP Purchase Order Number</h3>
		<p>To process the order you need to enter your SAP Purchase Order Number here.</p>
		<form method="post" onsubmit="checkSAPNumber()">
				<label style="color:#ff0000;">SAP Purchase Order Number</label><input type="text" id="sapNumber" name="sapNumber" size="20" />
		</form>
		<p>You CAN leave the site to obtain this. Any order in the cart will remain until you either delete it or process it.</p>
		</div>
		
		<p style="padding: 10px; font-size: 15px; border: 1px solid #ff0000; color: #000;">
			<?php
				$CART->fullPrice($_SESSION['username']);
			?>
		</p>
		
		<?php echo $CART->showDeliveryCost($_SESSION['username']); ?>
		</div>


				
		<?php
			echo $CART->showCart($_SESSION['username']);
		?>
		

		
		</div>
		
		
		
		
	</div>
	<div id="footer">
		<p>&copy; <?php echo (COPYRIGHT); ?> 2009</p>
	</div>
</div>

</body>
</html>